﻿using System;
using EasyCourse.Data.Entity;
using EasyCourse.Data.Redis;
using EasyCourse.Data.SqlServer;

namespace EasyCourse.Data
{
    public class DataContext
    {
        private SqlServerManager sqlServerManager;

        public SqlServerManager SqlServerManager
        {
            get
            {
                if (sqlServerManager == null)
                    sqlServerManager = new SqlServerManager();
                return sqlServerManager;
            }
        }

        public SystemUser GetSystemUser(string loginName)
        {
            return SqlServerManager.GetModel<SystemUser>(SqlString.QuerySystemUser, new System.Data.SqlClient.SqlParameter("@LoginName", loginName));
        }

    }
}
